package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.FamousInterviewVO;
import com.digitalchina.lxnsy.toolkit.FrescoUtil;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：白彦东
 * 创建时间：2016/12/28 18:10
 * 修改备注：
 * ================================================
 */

public class FamousHolder extends BaseViewHolder<FamousInterviewVO> {

    private TextView tvTitle;
    private TextView tvExTitle; // 专家职称
    private TextView tvAuthor;
    private TextView tvTime;
    private TextView tvReadingQuantity;
    private TextView tvExName;
    private SimpleDraweeView tvExImage;
    private TextView tvBriefIntroduction;


    public FamousHolder(ViewGroup parent) {
        super(parent, R.layout.item_famous_interview);
        tvTitle = $(R.id.fi_tv_title);
        tvExTitle = $(R.id.fi_tv_ex_title);
        tvAuthor = $(R.id.fi_tv_author);
        tvTime = $(R.id.fi_tv_time);
        tvReadingQuantity = $(R.id.fi_tv_readingQuantity);
        tvExName = $(R.id.fi_tv_ex_name);
        tvExImage = $(R.id.fi_iv_images);
        tvBriefIntroduction = $(R.id.fi_tv_ex_briefIntroduction);
    }

    @Override
    public void setData(FamousInterviewVO data) {
        super.setData(data);

        FrescoUtil.showImageSmall(data.getExpertPhoto(), tvExImage);
        tvTitle.setText(data.getTitle());
        tvExTitle.setText(data.getExpertTitle());
        tvAuthor.setText(data.getAuthor());
        tvTime.setText(data.getUpdateTime());
        tvReadingQuantity.setText(data.getReadingQuantity() + "浏览");
        tvExName.setText(data.getExpertName());
        tvBriefIntroduction.setText(data.getBriefIntroduction());
    }

}
